<HTML><HEAD><TITLE>get_var_bounds(?Var, -Lower, -Upper)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Term Manipulation</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>get_var_bounds(?Var, -Lower, -Upper)</H1>
Retrieve bounds of a numeric variable in a generic way
<DL>
<DT><EM>Var</EM></DT>
<DD>Variable or number.
</DD>
<DT><EM>Lower</EM></DT>
<DD>Float or variable.
</DD>
<DT><EM>Upper</EM></DT>
<DD>Float or variable.
</DD>
</DL>
<H2>Description</H2>
    This predicate is intended to be used on attributed variables that
    have a numeric domain.  The bound information is collected from the
    variable's attributes via their get_bounds-handlers. If several
    attributes contain bound information, the results are intersected
    to produce the tightest bound information available. An empty bound
    (Lower > Upper) can be returned.
<P>
    The bounds are always returned as floating point numbers, regardless
    of any integrality constraint on the variable.

<H3>Modes and Determinism</H3><UL>
<LI>get_var_bounds(?, -, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Var is not a variable or number
</DL>
<H2>Examples</H2>
<PRE>
    [eclipse 1]: lib(fd), lib(ic).
    yes.

    [eclipse 2]: ic:(X::3.0..9.0), fd:(X::1..7), get_var_bounds(X,L,U).
    X = X{ic : 3.0..9.0, fd:[1..7]}
    L = 3.0
    U = 7.0
    Yes (0.00s cpu)

    [eclipse 3]: get_var_bounds(X,L,U).
    X = X
    L = -1.0Inf
    U = 1.0Inf
    yes.

    [eclipse 4]: get_var_bounds(5,L,U).
    L = 5.0
    U = 5.0
    yes.

    [eclipse 5]: get_var_bounds(a,L,U).
    type error in get_var_bounds(a, L, U)
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/termmanip/set_var_bounds-3.html">set_var_bounds / 3</A>, <A HREF="../../kernel/termmanip/meta_attribute-2.html">get_bounds handler</A>
</BODY></HTML>
